<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>body{ text-align: center; color: white; background-color: rgba(0,0,0,0); user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
</head>
<body>
<h1>Events Demo</h1>
<br/>
The main program emits an event every 10s which will be displayed in the section below.
To send an event from this window, click here: <button onclick="wails.Events.Emit({name:'myevent', data:'hello!'})">Send Event</button>
<div id="results"></div>
</body>

<script>
    wails.Events.On("myevent", function(data) {
        let currentHTML = document.getElementById("results").innerHTML;
        document.getElementById("results").innerHTML = currentHTML + "<br/>" + JSON.stringify(data);
    })
</script>

</html>